//窗口控制 chrli 20190217

var resultDisplay = 0;
function offCanvasWrapperHide() {
	var offCanvasWrapper = mui('#offCanvasWrapper');
	offCanvasWrapper.offCanvas('close');

}
function bottomContainerHide() {
	var bottomContainer = mui('#bottomContainer');
	bottomContainer.offCanvas('close');

}



// function offCanvasWrapperShow() {
// 	var offCanvasWrapper = mui('#offCanvasWrapper');
// 	var offCanvasSide = document.getElementById("offCanvasSide2");
// 	var classList = offCanvasWrapper[0].classList;
// 	offCanvasSide.classList.remove('mui-transitioning');
// 	offCanvasSide.setAttribute('style', '');
// 	classList.remove('mui-slide-in');
// 	classList.remove('mui-scalable');
// 	classList.add('mui-slide-in');
// 	offCanvasWrapper.offCanvas().refresh();
// 	offCanvasWrapper.offCanvas('show');
// 	// mui("#offCanvasSide").offCanvas().show();
// }
function offCanvasWrapperSecondShow() {
	var offCanvasWrapper = mui('#offCanvasWrapper');
	var offCanvasSide2 = document.getElementById("offCanvasSide2");
	var classList = offCanvasWrapper[0].classList;
	offCanvasSide2.classList.remove('mui-transitioning');
	offCanvasSide2.setAttribute('style', '');
	classList.remove('mui-slide-in');
	classList.remove('mui-scalable');
	classList.add('mui-slide-in');
	offCanvasWrapper.offCanvas().refresh();
	offCanvasWrapper.offCanvas('show');
}
function AllWindowClose() {
	$('#resultListWin').css('display', 'none');
	$('#attachmentWin').css('display', 'none');
	$('#layerWin').css('display', 'none');
}
function openAttachementWin() {
	$('#attachmentWin').css('display', 'block');
}

function openResultWin() {  
	$('#resultListWin').css('display', 'block'); 

}
function openResult() {
	$('#resultList').css('display', 'block');
		$('#resultListWin').css('display', 'block'); 
}

function openLayerWin() {
	$('#layerWin').css('display', 'block');
}
// function closeLayerWin() {
// 	$('#layerWin').css('display', 'none');
// }

function setResultTitle(nameFun) {
	switch(nameFun) {
		//绘制多边形查询
		case "qy":
			document.getElementById("resulitTitle").innerText = "区域查询";
			break;
		//条件查询	
		case "dtj":
			document.getElementById("resulitTitle").innerText = "条件查询";
			break;
		case "zb":
			document.getElementById("resulitTitle").innerText = "周边查询";
			break;
		case "fj":
			document.getElementById("resulitTitle").innerText = "附件查询";
			break;
		case "gjz":
			document.getElementById("resulitTitle").innerText = "关键字查询";
			break;
		case "dmdz":
			document.getElementById("resulitTitle").innerText = "地名地址查询";
			break;
		case "pois":
			document.getElementById("resulitTitle").innerText = "兴趣点查询";
			break;
		default:
			alert("未定义nameFun");
	}
}

function openNewWindow(id, href, title, param) {
	//非plus环境，直接走href跳转
	if(!mui.os.plus) {
		location.href = href;
		return;
	}
	if(href && ~href.indexOf('.html')) {
		//打开窗口的相关参数
		var options = {
			styles: {
				popGesture: "close",
				statusbar: {
					background: "#f7f7f7"
				}
			},
			extras: {
				title: title,
				param: param
			}
		};
		options.styles.bounce = "vertical";
		options.styles.hardwareAccelerated = true;
	}

	//打开新窗口
	mui.openWindow(href, id, options);
};